package com.zlx.mall.basic.resource;

import java.util.Optional;

/**
 * @author qingke
 **/
public interface IResourceService {

    /**
     * Get resource
     *
     * @param resource Resource code enum
     * @param tClass   resource value class
     * @param <T>      resource value class
     * @return Optional resource value
     */
    <T> Optional<T> get(ResourceEnum resource, Class<T> tClass);

    /**
     * Get resource
     *
     * @param resource     Resource code enum
     * @param tClass       resource value class
     * @param defaultValue default resource value if not exist
     * @param <T>          resource value class
     * @return Optional resource value
     */
    <T> T get(ResourceEnum resource, Class<T> tClass, T defaultValue);
}
